/// @tags: BinarySearch on BIT
#include <algorithm>
#include <cstdio>
#include <iostream>

using namespace std;

namespace BlueQuantum {

typedef long long LL;

int const N = 2e6 + 5, BIT = 21;

int hash[N];
LL sum;

struct query {
  int opt;
  int t, x, y;
} a[N];

struct BinaryIndexedTree {
  LL a[N];

  inline LL operator[](int index) const { return a[index]; }

  inline int lowbit(int x) { return x & (-x); }

  inline void add(int x, int y) {
    while (x <= *hash) a[x] += y, x += lowbit(x);
  }

  inline LL query(int x) {
    LL ans = 0;
    while (x) ans += a[x], x -= lowbit(x);
    return ans;
  }
} ice, fire;

inline int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i].opt;
    switch (a[i].opt) {
      case 1:
        cin >> a[i].t >> a[i].x >> a[i].y;
        hash[i] = a[i].x;
        break;
      case 2:
        cin >> a[i].t;
    }
  }
  sort(hash + 1, hash + n + 1);
  *hash = unique(hash + 1, hash + n + 1) - hash - 1;
  for (int i = 1; i <= n; ++i)
    if (a[i].opt == 1) a[i].x = lower_bound(hash + 1, hash + *hash + 1, a[i].x) - hash;
  for (int i = 1; i <= n; ++i) {
    switch (a[i].opt) {
      case 1:
        a[i].t == 0 ? ice.add(a[i].x, a[i].y)
                    : (sum += a[i].y, fire.add(a[i].x + 1, a[i].y));
        break;
      case 2:
        int k = a[i].t;
        a[k].t == 0 ? ice.add(a[k].x, -a[k].y)
                    : (sum -= a[k].y, fire.add(a[k].x + 1, -a[k].y));
    }
    LL icesum = 0, firesum = sum;
    LL f1 = 0, f2 = 0;
    int pos = 0, pos2 = 0;
    for (int i = BIT - 1; i >= 0; --i) {
      int npos = pos + (1 << i);
      if (npos > *hash) continue;
      int nicesum = icesum + ice[npos], nfiresum = firesum - fire[npos];
      if (nicesum < nfiresum) {
        pos = npos;
        icesum = nicesum, firesum = nfiresum;
      }
    }
    f1 = icesum, icesum = 0, firesum = sum;
    if (pos < *hash) {
      f2 = min(ice.query(pos + 1), sum - fire.query(pos + 1));
      for (int i = BIT - 1; i >= 0; --i) {
        int npos = pos2 + (1 << i);
        if (npos > *hash) continue;
        int nicesum = icesum + ice[npos], nfiresum = firesum - fire[npos];
        if (nicesum < nfiresum) {
          pos2 = npos;
          icesum = nicesum, firesum = nfiresum;
        } else if (min(nicesum, nfiresum) == f2) {
          pos2 = npos;
          icesum = nicesum, firesum = nfiresum;
        }
      }
    }
    if (max(f1, f2) == 0) cout << "Peace\n";
    else if (f1 > f2)
      cout << hash[pos] << ' ' << f1 * 2 << '\n';
    else
      cout << hash[pos2] << ' ' << f2 * 2 << '\n';
  }
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("P6619 [省选联考 2020 AB 卷] 冰火战士.in", "r", stdin);
  freopen("P6619 [省选联考 2020 AB 卷] 冰火战士.out", "w", stdout);
#endif
#endif

  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
